import tornado.ioloop
import tornado.web
from controller import *
from tornado.options import define, options

settings = {
    "debug": True,
}


class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("Hello, world")


def make_app():
    return tornado.web.Application([
        (r"/", MainHandler),
        (r"/wxlogin", user.SessionHandler),
        (r"/analyses", user.analysesHandler),
        (r"/analysis/([0-9]+)", user.analysisHandler),
    ], **settings)


if __name__ == "__main__":
    app = make_app()
    tornado.options.parse_command_line()
    app.listen(10080)
    tornado.ioloop.IOLoop.current().start()

